package com.kuang.demo.service.wx;

import com.kuang.demo.bo.zzywx.home.*;
import com.kuang.demo.mapper.wx.WXHomeMapper;
import jdk.nashorn.internal.runtime.ListAdapter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WXHomeServiceImpl implements WXHomeService {

    @Autowired
    WXHomeMapper wxHomeMapper;

    public ReHome selectIndex(){
        //newGoodsList
        List<GoodsList1> newGoodsList = wxHomeMapper.selectNewGoods();

        //coupinList
        List<CouponList1> couponList = wxHomeMapper.selectCouponList();

        //channel
        List<ChannelList1> channel = wxHomeMapper.selectChannelList();

        //grouponList
        List<GroupOnList> groupOnList = wxHomeMapper.selectGroupOnList();

        //banner
        List<Banner1> banner = wxHomeMapper.selectBanner();

        //brandList
        List<Brand1> brandList = wxHomeMapper.selectBrandList();

        //hostGoodsList
        List<GoodsList1> hostGoodsList = wxHomeMapper.selectHotGoods();

        //topicList
        List<TopicList> topicList = wxHomeMapper.selectTopicList();

        //floorGoodsList
        //TODO:null
        List<FloorGoods> list = null;

        ReHome reHome = new ReHome();
        reHome.setNewGoodsList(newGoodsList);
        reHome.setCouponList(couponList);
        reHome.setChannel(channel);
        reHome.setGrouponList(groupOnList);
        reHome.setBanner(banner);
        reHome.setBrandList(brandList);
        reHome.setHotGoodsList(hostGoodsList);
        reHome.setTopicList(topicList);
        reHome.setFloorGoodsList(list);
        return reHome;
    }
}
